
package {
	import common.debug.Debug;
	import common.debug.Stats;
	
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	
	import game.control.Login;
	import game.control.Scene;
	import game.manager.LayerManager;
	import game.manager.RendererManager;
	import game.manager.StageManager;
	
	
	/**
	 * FireCharge
	 *
	 * @author chris
	 *
	 * Apr 8, 2013
	 */
	[SWF(frameRate=30,width="1200",height="720")]
	public class FireCharge extends Sprite {
		public static var app:FireCharge;
		
		public function FireCharge()
		{
			super();
			this.addEventListener(Event.ADDED_TO_STAGE,onAdded);
		}
		
		private function onAdded(evt:Event):void {
			this.stage.scaleMode = StageScaleMode.NO_SCALE;
			this.stage.align     = StageAlign.TOP_LEFT;
			app = this;
			new Stats();
			var flashVars:Object = stage.loaderInfo.parameters;
			for(var d:String in flashVars) {
				Debug.log(d);
			}
			initManager();
			initController();
		}
		
		private function initController():void {
			Login.inst;
			LayerManager.inst.loginLayer.visible = false;
			Scene.inst.enterScene(4);
		}
		
		private function initManager():void {
			StageManager.inst.registe(this.stage);
			LayerManager.inst.initLayers(this);
			RendererManager.inst.start();
		}
		
	}
}